package com.rupeng;

import org.mortbay.http.SocketListener;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.ServletHttpContext;

public class StartServer {
	public static void main(String[] args) {
		Server server = new Server();
		try {
			SocketListener listener = new SocketListener();
			listener.setPort(20);
			server.addListener(listener);
			ServletHttpContext context = (ServletHttpContext) server
					.addContext("/");
			context.addServlet("/test", "com.rupeng.TestServlet");
			context.addServlet("/hello", "com.rupeng.HelloServlet");
			context.addServlet("/love", "com.rupeng.LoveServlet");
			server.start();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
